<template>
	<view class="uni_box login">
		<navbar :isback="true">
		</navbar>
		<view class="content">
			<view class="logoview">
				<image :src="ossThree('/uploads/20250404/573dd121b664a0b0565b364c65a10f31.png')" mode="" class="lotou"/>
				<text class="biaoti">东方蓉妍</text>
			</view>
			
			<view class="dengbtn" @click="getlogin">快速绑定手机号</view>
			<view class="dengbtn quxiao" @click="getfan">取消绑定</view>
			<!-- <view class="item_desc">
				<u-checkbox 
					@change="checkboxChange" 
					v-model="checked"
					active-color='#06C15F'
					icon-size='10'
					label-size='24'
					size='26'
				>
				<view class="desctext">
					登录即代表您同意
					<text style="color: #06C15F;" @click.stop="routerTo('/pages/my/yhXieyi?key=agreement')">《隐私协议》</text>
				</view>
				</u-checkbox>
			</view> -->

			
			
		</view>
		<u-toast ref="uToast" />
		<u-action-sheet :list="actionSheetList" v-model="show" @click="actionSheetCallback"></u-action-sheet>
		<u-action-sheet :list="yuyanlist" v-model="showyuyan" @click="actionSheetCallbackyuyan"></u-action-sheet>
	</view>
</template>
<!-- <script src="https://cdn.bootcss.com/babel-polyfill/7.4.3/polyfill.min.js"></script>
<script src="https://www.yunpian.com/static/official/js/libs/riddler-sdk-0.2.2.js?t=20210720"></script> -->
<script>
	
	export default {
		data() {
			return {
				email: "",
				password: "",
				isyanzheng:false,
				checked:true,
				timer: null,
				time: 60,
				isTimer: false,
				iseyes:false,
				type_number: "text",
				type_password: "password",
				code:'',
				value: '',
				type: 'password',
				passwordIcon: true,
				border: false,
				show: false,
				showyuyan:false,
				yuyan:'简体中文',
				session_key:''

			}
		},
		computed: {
		},
		onLoad(option){
			console.log(option)
			if(option.session_key){
				this.session_key = option.session_key
			}
		},
		onReachBottom: function() {},
		methods: {
			getfan(){
				uni.navigateBack({ delta: 1 })
			},
			getlogin(){
				if(!this.checked){
					this.$u.toast("请先勾选协议");
					return;
				}
				uni.login({
					provider: 'weixin',
					timeout: 3000,
					success: res => {
						console.log(res)
						if (res.code) {
							this.getLogintwo(res.code)
						}
					},
					fail: () => {
						uni.$u.toast("请求失败")
					}
				})
			},
			async getLogintwo(code){
				let res = await this.$u.api.miniapplogin({
					code:code
				});
				console.log(res)
				
				// let resd = await this.$u.api.auth_login({
				// 	key:res.key
				// });

				// // this.seeion_key = res.seeion_key
				// uni.setStorageSync('token',resd.token)
				// this.$store.commit('user/changeToken', resd.token);
				// if(res.data.mobile){
				// 	uni.setStorageSync('mobile', res.data.mobile);//存取手机号
				// }
				// this.$store.commit('changeJiaose', data.jiaose);
				this.$u.toast('登录成功');
				setTimeout(() => {
					uni.switchTab({ url: '/pages/tabbar/ClientHome',animationType:'slide-in-right' })
				}, 1000);

			},
		}
	};
</script>

<style scoped lang="scss">
	page{
		background-color: #fff;
	}
	.login {
		.slot_right {
			display: flex;
			align-items: center;

			.nav_img {
				width: 48rpx;
				height: 48rpx;
				margin-right: 26rpx;
			}
		}

		.content {
			padding: 120rpx 35rpx 0;
			display: flex;
			flex-direction: column;
			// height: 90vh;
			min-height: 100vh;
			box-sizing: border-box;
			background-color: #fff;
			.contenthead{
				display: flex;
				flex-direction: row;
				align-items: center;
				.right{
					margin-left: auto;
				}
				.yanxuan{
					width: 28rpx;
					height: 28rpx;
					margin-right: 10rpx;
				}
				.xia{
					width: 17rpx;
					height: 13rpx;
					margin-left: 8rpx;
					position: relative;
					top: 5rpx;
				}
				.ltext{
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 500;
					color: #333333;
				}

			}
			.lotou{
				width: 150rpx;
				height: 150rpx;
				margin: 30rpx 0 40rpx;
			}
			.biaoti{
				font-size: 32rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #333333;
			}
			.dengbtn{
				height: 88rpx;
				background: #06C15F;
				border-radius: 20rpx;
				display: flex;
				align-items: center;
				justify-content: center;
				font-weight: bold;
				font-size: 32rpx;
				color: #FFFFFF;
			}
			.quxiao{
				background: #CCCCCC;
				margin-top: 40rpx;
			}
			.ltext{
				font-size: 50rpx;
				font-family: PingFang SC;
				font-weight: bold;
				color: #333333;
				display: block;
				margin-bottom: 70rpx;
			}
			.zhangnav{
				width: 360rpx;
				margin: 0 auto 40rpx;
				display: flex;
				flex-direction: row;
				.zhangnavitem{
					width: 50%;
					display: flex;
					flex-direction: column;
					align-items: center;
					.xian{
						width: 100%;
						height: 4rpx;
						background: #999999;
					}
					.tit{
						font-size: 28rpx;
						font-family: PingFang SC-Regular, PingFang SC;
						font-weight: 400;
						color: #999999;
						display: inline-block;
						margin-bottom: 8rpx;
					}
					
				}
				.active .xian{
					background: #73FAB5;
				}
				.active .tit{
					color: #73FAB5;
					font-weight: bold;
				}
			}
			.listitem{
				width: 100%;
				height: 100rpx;
				border: 1rpx solid #C8C9D1;
				border-radius: 10rpx;
				padding: 0 35rpx;
				margin-bottom: 36rpx;
				display: flex;
				flex-direction: row;
				align-items: center;
				.qu{
					font-size: 28rpx;
					font-family: PingFang SC-Regular, PingFang SC;
					font-weight: 400;
					color: #FFFFFF;
					margin-right: 20rpx;
				}
				.iteminput{
					font-size: 28rpx;
					color: #fff;
					width: 70%;
					height: 70%;
					background: #222222;
					border: none;
				}
				.iteminput:active{
					border: none;
				}
				.iteminput:focus {
				    outline:none;
				    border: none;
				}
				.yanright{
					margin-left: auto;
					display: flex;
					align-items: center;
				}
				.fayan{
					margin-left: auto;
					font-size: 28rpx;
					font-family: PingFang SC-Regular, PingFang SC;
					font-weight: 400;
					color: #73FAB5;
				}
				.yan{
					// margin-left: auto;
					width: 44rpx;
					height: 44rpx;
				}
				.youitem{
					display: flex;
					flex-direction: row;
					width: 22%;
					height: 70%;
					justify-content: flex-end;
					align-items: center;
					.youitems{
						// width:50%;
						padding: 0px 8px;
						background: #2A64E4;
						color: #fff;
						font-size: 11px;
						display: flex;
						flex-direction: row;
						align-items: center;
						justify-content: center;
						border-radius: 7px;
						margin-left: 5px;
					}
					.xia{
						width:17rpx;
						height:13rpx;
						margin-left:10rpx;
					}
					.youtext{
						color:#333;
						font-size:25rpx;
					}
				}
			}
            .zhuce{
				display: flex;
				flex-direction: row;
				
				.zhuceitem{
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #999999;
				}
				.wangji{
					margin-left: auto;
					font-size: 28rpx;
					font-family: PingFang SC;
					font-weight: 400;
					color: #999999;
				}
			}
			// 按钮样式开始
			.bot{
				margin-top: 100rpx;
				.botbtn{
					width: 100%;
					height: 88rpx;
					position: relative;
					background: #8A1596;
					border-radius: 10rpx;

					.btnbg{
						width: 100%;
						height: 100%;
						position: absolute;
						z-index: 0;
					}
					.btnbgview{
						position: relative;
						z-index: 1;
						width: 100%;
						height: 100%;
						display: flex;
						align-items: center;
						justify-content: center;
						font-size: 36rpx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #FFFFFF;
					}
				}
			}
			// 按钮样式结束
			.item_desc{
				margin-top: auto;
				display: flex;
				align-items: center;
				justify-content: center;
				margin-bottom: 50rpx;
				.desctext{
					display: flex;
					align-items: center;
					color:#999;
					font-size: 26rpx;
				}
			}
		}
	}
	.logoview{
		display: flex;
		align-items: center;
		justify-content: center;
		margin:70rpx 0 100rpx;
		flex-direction: column;
	}
	.shenqing{
		margin-top: auto;
		display: flex;
		align-items: center;
		justify-content: center;
		// position: fixed;
		// bottom: 10rpx;
		position: relative;
		width: 100%;
		margin: 30rpx 0;
		text{
			color: rgb(138, 21, 150);
			font-size: 28rpx;
			font-weight: 400;
			display: block;
			text-align: center;
		}
	}
</style>
